php forum
php mysql forum
php mysql smarty
 
Topic Options
#315358 - 08/22/07 02:03 PM [7,x] Force board url
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
www.board.com, board.com, forum.board.com bla die bla stuff.

All those different url's? That's cookie login problems. This little hack will force your board to use the url from the Full URL to Main Directory setting in control panel.

open ubbthreads.php and find:

require_once("libs/ubbthreads.inc.php");

add below:

Code:
// Force URL to FULL_URL config setting to avoid cookie problems.
$forcehost = parse_url($config['FULL_URL'],PHP_URL_HOST);
$subhost = $_SERVER['HTTP_HOST'];
if ($subhost!=$forcehost) 
{
	$newheader="Location: http://$forcehost".$_SERVER['REQUEST_URI'];
	header($newheader);
	exit;
} // end if


You can do this also with .htaccess stuff (see Gizmo's post on ubb central), but I prefer it this way. This makes every wrong url ok.
_________________________

Top
#315359 - 08/22/07 03:07 PM Re: [7,x] Force board url [Re: blaaskaak]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
Or you could just try doing the .htaccess trick I posted over at central ("non-www to www urls", in the faq forum); one update globally forces users to use one URL at all times, and you don't have to re-apply each time you upgrade wink...

What I do on my forums however, since I own numerous domains and allow SSL, is set it so people can access the board from anywhere, granted cookie issues can arise, but I figure if someone is specifially accessing the site via our .net or .org (or ssl) there's a reason for it (such as an anal retentive sysadmin at their office).
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#315360 - 08/22/07 03:14 PM Re: [7,x] Force board url [Re: Gizmo]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
Originally Posted By: Gizmo
Or you could just try doing the .htaccess trick I posted over at central ("non-www to www urls", in the faq forum); one update globally forces users to use one URL at all times, and you don't have to re-apply each time you upgrade wink...


If you are worried about re-applying hacks you are at the wrong forum here wink wink laugh

What I don't like about the .htaccess trick is that you have to make an entry for "each wrong case". This hack just checks if it's wrong and fixes it.

B.t.w., I linked to your .htaccess method post on ubb central in the first post.

Quote:
What I do on my forums however, since I own numerous domains and allow SSL, is set it so people can access the board from anywhere, granted cookie issues can arise, but I figure if someone is specifially accessing the site via our .net or .org (or ssl) there's a reason for it (such as an anal retentive sysadmin at their office).


We have 2 main url's, and without this little trick, we had loads of people complaining about suddenly not being logged in.
_________________________

Top
#315361 - 08/22/07 03:29 PM Re: [7,x] Force board url [Re: blaaskaak]
sirdude Offline
Enthusiast

Registered: 11/08/03
Posts: 490
Loc: SoCal
i like it blaaskaak ! :rawk:
_________________________

Top
#315362 - 08/22/07 03:34 PM Re: [7,x] Force board url [Re: sirdude]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
A problem we've found is that some sys admin's go power hungry and ban everything that they deem inappropriate at work, in this case is them banning our NEWS site and saying it's a "hacker's haven" (the word of admin here)... So we allow multiple urls as well as ssl as ways to subvert this...

Which is funny, since 90% of the time, you can get around ban's of a site if they run ssl (go fig!)
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#315370 - 08/23/07 12:39 AM Re: [7,x] Force board url [Re: Gizmo]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 329
Loc: The Netherlands
Originally Posted By: Gizmo
A problem we've found is that some sys admin's go power hungry and ban everything that they deem inappropriate at work,


Ah, luckely that's something we never do (I'm a sys admin at a regional broadcast station (tv and radio), loads of journalists, who, if needed, have to be able to look up everything).

Quote:
Which is funny, since 90% of the time, you can get around ban's of a site if they run ssl (go fig!)


But ubb will forward them at certain times to the default URL. So when actively using the board, they will end up at that default URL. This behavior of ubb was one of the reasons to implement it.
_________________________

Top
#315372 - 08/23/07 12:45 AM Re: [7,x] Force board url [Re: blaaskaak]
sirdude Offline
Enthusiast

Registered: 11/08/03
Posts: 490
Loc: SoCal
i'm gonna implement your mod, blaaskaak..

and it's soooo simple even a caveman can do it... (inside joke about a commercial running for geico insurance)

ty,
SD
_________________________

Top
#315538 - 09/05/07 07:32 AM Re: [7,x] Force board url [Re: sirdude]
Carte Blanche Offline
Newbie

Registered: 10/08/06
Posts: 21
Loc: Auckland, NZ
Ya know, when I was back home in the states in July and saw that ad campaign, I thought... what a stupid campaign. I come back to the states and I'm wanting to see quality commercials!!!

Top



Moderator:  sirdude 
Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks